const OSS = require('ali-oss');

const client = new OSS({
  region: 'oss-cn-guangzhou',
  accessKeyId: 'LTAI5tCGnRdgcg94rf133pLw',
  accessKeySecret: 'mxhDZJSRsUUHmY9afW92N9fyGrxjSR',
  bucket: 'hsm-image-bucket',
})
// oss-cn-guangzhou.aliyuncs.com

exports.putOSS = async (filePath, file) => {
    try {
        const result = await client.put(filePath, file);
        return result
    } catch(err) {
        console.log(err)
    }
};

exports.deleteOSS = async (filePath) => {
    try {
        const result = await client.delete(filePath);
        return result
    } catch(err) {
        console.log(err)
    }
}